<%@page import="com.wsdcd.zlg.model.entity.Order"%>
<%@page import="sun.security.mscapi.CKeyPairGenerator.RSA"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>产品信息修改</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/resource/layui/css/layui.css"
	media="all">
<script type="text/javascript"
	src="<%=request.getContextPath()%>/resource/js/jquery-3.6.0.min.js"></script>

</head>
<body>

	<fieldset class="layui-elem-field layui-field-title"
		style="margin-top: 20px;">
		<legend>产 品 信 息 修 改</legend>
	</fieldset>

	<form class="layui-form" action="">
	
		<div class="layui-form-item">
			<label class="layui-form-label">产品编号</label>
			<div class="layui-input-inline">
				<input type="text" name="productId" lay-verify="productId"
					autocomplete="off" disabled class="layui-input  layui-disabled" value="${ updateProduct.productId }">
			</div>
		</div>
		
		<div class="layui-form-item">
			<label class="layui-form-label">产品名称</label>
			<div class="layui-input-inline">
				<input type="text" name="productName" lay-verify="productName"
					autocomplete="off" class="layui-input" value="${ updateProduct.productName }">
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">产品种类</label>
			<div class="layui-input-inline">
				<input type="text" name="productType" lay-verify="productType"
					autocomplete="off" class="layui-input" value="${ updateProduct.productType }">
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">状态</label>
			<div class="layui-input-block">
				<input type="radio" name="status" value="有效产品" title="有效产品" checked="">
				<input type="radio" name="status" value="停产" title="停产">
			</div>
		</div>

		<div class="layui-form-item layui-form-text">
    		<label class="layui-form-label">产品介绍</label>
    		<div class="layui-input-block">
      		<textarea placeholder="请输入内容" class="layui-textarea" id="productIntroduction" name="productIntroduction" value="${ updateProduct.productIntroduction }"></textarea>
    		</div>
  		</div>
		
		<div class="layui-form-item layui-form-text">
    		<label class="layui-form-label">相关图片</label>
    		<div class="layui-input-block">
      		<textarea placeholder="请输入内容" class="layui-textarea" id="relatedPictures" name="relatedPictures" value="${ updateProduct.relatedPictures }"></textarea>
    		</div>
  		</div>

		<div class="layui-form-item">
			<div class="layui-input-block">
				<button type="submit" class="layui-btn" lay-submit=""
					lay-filter="submitButton">立即提交</button>
				<button type="reset" class="layui-btn layui-btn-primary">重置</button>
			</div>
		</div>
	</form>

	<script src="<%=request.getContextPath()%>/resource/layui/layui.js"
		charset="utf-8"></script>
		
	<script type="text/javascript">
		window.onload = function(){
			document.getElementById("productIntroduction").value ="${ updateProduct.productIntroduction }";
			document.getElementById("relatedPictures").value ="${ updateProduct.relatedPictures }";
		}
	</script>

	<script>
		layui
				.use(
						[ 'form', 'layedit','laydate' ],
						function() {
							var form = layui.form;
							var layer = layui.layer;
							var laydate = layui.laydate;
							
							//监听提交
							form.on('submit(submitButton)', function(data) {
								$.post("updates",data.field, function(obj) {
									if (obj.result == 1) {
										layer.msg(obj.msg, {
											icon : 1,
											time : 2000
										});
										return false;
									} else {
										layer.msg(obj.msg, {
											icon : 2,
											time : 2000
										});
										return false;
									}
								});

								return false;
							});
							
						});
	</script>

</body>
</html>